<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PayChannel</title>
<link href="styles/general.css" rel="stylesheet" type="text/css" /><link href="styles/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/transport.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
     <script type="text/javascript" src="js/sorttable.js"></script>
    <script src="js/utils.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="js/DatePicker4.72/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript" src="js/jquery/jquery-1.3.2.js"></script>
	
</head>

<body>
	<h1>
		<span class="action-span1"><a href="mainframe.jsp">首页</a></span>
		<span id="search_id" class="action-span1">- CPA用户数确认 </span>
    </h1>
    <form method="post" action="channelpercent_index.do?msg=query">
    <div class="list-div"   style="margin-bottom: 5px;width: 100%;" align="center">
        <table width="80%"  cellspacing="1" cellpadding="2" > 
            <tbody>
				<tr height="30">
					<td align="right">开始日期：</td>
					<td align="left"><input type="text" size="25" name="parms['startdate']" id="parms['startdate']" 
					    onFocus="WdatePicker({isShowWeek:true,dateFmt:'yyyyMMdd',skin:'whyGreen'})" 
					    value="<s:property value='parms["startdate"]' />"/></td>
					<td align="right">结束日期：</td>
					<td align="left"><input type="text" size="25" name="parms['enddate']" id="parms['enddate']" 
					    onFocus="WdatePicker({isShowWeek:true,dateFmt:'yyyyMMdd',skin:'whyGreen'})" 
					    value="<s:property value='parms["enddate"]' />"/></td>
				</tr>
				<tr>
					<td align="center" colspan="4"><input type="submit" value=" 查询 " class="button" /></td>
				</tr>
			</tbody>
		</table>
	</div>
	</form>
   <!-- start ad menu list -->
    <div class="list-div" id="listDiv">
    <form method="post" action="channelpercent_save.do?msg=saveusernum">
        <table width="100%" cellspacing="1" cellpadding="2" class="sortable">
            <tbody>
                <tr>
                    <th>序号</th>
                    <th>日期</th>
			        <th>渠道</th>
			        <th>运营商</th>
			        <th>游戏</th>
			        <th>收入</th>
			        <th>用户数</th>
			        <th>渠道用户数</th>
			        <th>ARPU</th>
                </tr>
                <s:if test="chuserlist.size()>0">
  				<s:iterator value="chuserlist" var="chuser" status="i">
  					 <tr>
                       <td style="background-color: rgb(255, 255, 255);"><s:property value="#i.count"/></td>
					   <td style="background-color: rgb(255, 255, 255);"><s:property value="day"/><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].day" value="<s:property value="day" />" /></td>
					   <td style="background-color: rgb(255, 255, 255);"><s:iterator value="chlist"><s:if test="id.equals(channelid)"><s:property value="name" /></s:if></s:iterator><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].channelid" value="<s:property value="channelid" />" /></td> 
					   <td style="background-color: rgb(255, 255, 255);"><s:if test='operator==""'>未知</s:if><s:else><s:property value="operator" /></s:else><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].operator" value="<s:property value="operator" />" /></td>
					   <td style="background-color: rgb(255, 255, 255);"><s:iterator var="apv" value="apvlist"><s:if test="#chuser.appversionnumber.equals(#apv.appversionnumber)"><s:property value="appname" /></s:if></s:iterator><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].appversionnumber" value="<s:property value="#chuser.appversionnumber" />" /><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].appnumber" value="<s:property value="#chuser.appnumber" />" /></td>
					   <td style="background-color: rgb(255, 255, 255);"><s:property value="fee" /><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].fee" value="<s:property value="fee" />" /><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].chid" value="<s:property value="chid" />" /></td>
					   <td style="background-color: rgb(255, 255, 255);"><s:property value="sum1" /><input type="hidden" name="chuserlist[<s:property value="#i.index"/>].sum1" value="<s:property value="sum1" />" /></td>
					   <td style="background-color: rgb(255, 255, 255);"><input size="10" onchange="inputChange(this.value,<s:property value="fee" />,<s:property value="#i.count" />);" name="chuserlist[<s:property value="#i.index"/>].sum" id="" value="<s:property value="sum" />" /></td>
					   <td style="background-color: rgb(255, 255, 255);"><div id="arpu_<s:property value="#i.count" />"><s:property value="%{computearpu(fee,sum)}" /></div></td>
  					</tr>
  				</s:iterator>
  				<tr><td style="background-color: rgb(255, 255, 255);" align="center" colspan="9"><input type="button" onclick="if((confirm('确定要提交吗？'))) this.form.submit();" value="确认提交" height="30px" width="50px" /></td></tr>
  				</s:if>
  				<s:else>
  				<tr><td style="background-color: rgb(255, 255, 255);" colspan="9" align="center">无</td></tr>
  				</s:else>
  			</tbody>
  		</table>
  		</form>
  </div>
 <!--Bottom开始-->
    <script language="JavaScript">

if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#eeeded';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }

}
function inputChange(val,fee,i){
	var v = "--";
	if(fee>0&&val>0){
		v=(fee/val).toFixed(2);
	}
	$("#arpu_"+i).text(v);
}
    </script>
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
</body>
</html>